import request from '@/utils/request'

// 查询最终分数列表
export function listFinalScore(query) {
  return request({
    url: '/system/assessScore/list',
    method: 'get',
    params: query
  })
}

// 查询用户及其最终分数信息
export function getScoreWithUsers(query) {
  return request({
    url: '/system/assessScore/getScoreWithUsers',
    method: 'get',
    params: query
  })
}

// 获取某用户在月份内每天的总分（yearMonth: yyyy-MM, userId 可选）
export function getMonthDailyScores(query) {
  return request({
    url: '/system/assessScore/month/dailyScores',
    method: 'get',
    params: query
  })
}

// 查询最终分数详细
export function getFinalScore(userId, assessMonth) {
  return request({
    url: '/system/finalScore/' + userId + '/' + assessMonth,
    method: 'get'
  })
}

// 新增最终分数
export function addFinalScore(data) {
  return request({
    url: '/system/finalScore',
    method: 'post',
    data: data
  })
}

// 修改最终分数
export function updateFinalScore(data) {
  return request({
    url: '/system/finalScore',
    method: 'put',
    data: data
  })
}

// 删除最终分数
export function delFinalScore(userId, assessMonth) {
  return request({
    url: '/system/finalScore/' + userId + '/' + assessMonth,
    method: 'delete'
  })
}

// 导出最终分数
export function exportFinalScore(query) {
  return request({
    url: '/system/finalScore/export',
    method: 'get',
    params: query
  })
}

